<?
$title = 'Events and Conferences';
include("includes/functions.php");include("includes/sajax/functionsSajax.php");include("includes/sajax/sajax.php");
include("includes/header.php"); 
?><div style="text-align: left;"><?	if (!empty($_GET[eID])) {		// Get info for this event		$sql = "SELECT * from casa_events WHERE EID = '$_GET[eID]'";
		$result = mysql_db_query($dbname,$sql);		$row = mysql_fetch_assoc($result);
		$eID       = $row[EID];		$eTitle    = stripslashes($row[EventTitle]);		$eLocation = stripslashes($row[EventLocation]);		$eDesc     = stripslashes($row[EventDesc]);		$eURL      = $row[EventURL];		$eRegURL   = $row[EventRegURL];
		$eFile     = $row[EventFile];		$dateTimeStart = convertDateTime($row[DateStart]);		$dateTimeEnd   = convertDateTime($row[DateEnd]);		$eTimes    = $row[EventTimes];		$eReg      = $row[Registration];		$active    = $row[Active];
		$dateStart = $dateTimeStart[0];		$dateEnd   = $dateTimeEnd[0];
		echo '<div style="width: 650px; float: left;"></div>				<div style="float: right;"><div class="viewEventsLink"><a href="events.php">View all events</a></div></div>				<div style="clear: both;"></div>';
		echo '<div id="eventContent" style="margin-top: -33px;"><h1>'.$eTitle.'</h1>';		echo '<p>'.$dateStart;		if (!empty($dateEnd)) {			echo ' to '.$dateEnd;		}		echo '</p>';		if (!empty($eTimes)) {			echo '<p>Times: '.$eTimes.'</p>';					}		echo '<br />';		if (!empty($eLocation)) {			echo '<p class="sectionLocation">'.$eLocation.'</p>';		}		if (!empty($eURL)) {			echo '<p class="sectionWebsite"><a href="'.$eURL.'" target="_blank">Event website</a></p>';		}		
		
		// Check for attached file
		$eFilePath = DOC_DIR.'docs/Event Files/'.$eFile;
		$eFileWebPath = SITE_URL.'/docs/Event Files/'.$eFile;
		if (is_file($eFilePath)) {
			echo '<p><b>Attached File:</b> <a href="'.$eFileWebPath.'" target="_blank">'.$eFile.'</a></p>';
		}
				if (!empty($eDesc)) {			echo '<p>'.$eDesc.'</p>';		}		if ($eReg == 1) {			if (!empty($eRegURL)) {				$regURL = $eRegURL;			} else {				$regURL = 'register.php?eID='.$eID;			}			echo '<div class="bluBox"><a href="'.$regURL.'" class="regLink">Register for this event</a></div>';		}		echo '</div>';	} else {				// Render all active events		$sql = "SELECT * from casa_categories WHERE CatType = 'C' ORDER BY CatName";		$result = mysql_db_query($dbname,$sql);				while ($value = mysql_fetch_assoc($result)) {			$catID   = $value[CID];			$catName = stripslashes($value[CatName]);								$sql2 = "SELECT * from casa_events WHERE ECat = '$catID' AND Active = 1 ORDER BY DateStart ASC"; 			$result2 = mysql_db_query($dbname,$sql2);			$rows2 = mysql_num_rows($result2);						$eventString .= '<h1>'.$catName.'</h1>';
			if ($rows2>0) {				$i=1;							$eventString .= '<table class="gridTable" style="width: 100%;">';				while ($value2 = mysql_fetch_assoc($result2)) {					if (($i % 2) > 0) { $class = 'noRowClass'; }					else { $class = "altRow"; }					$eID       = $value2[EID];					$eTitle    = stripslashes($value2[EventTitle]);					$eDesc     = stripslashes($value2[EventDesc]);					$eURL      = $value2[EventURL];					$eRegURL   = $value2[EventRegURL];					$dateTimeStart = convertDateTime($value2[DateStart]);					$dateTimeEnd   = convertDateTime($value2[DateEnd]);					$eTimes    = $value2[EventTimes];					$eReg      = $value2[Registration];					$active    = $value2[Active];
					$dateStart = $dateTimeStart[0];					$dateEnd   = $dateTimeEnd[0];
					$eventString .= '<tr class="'.$class.'" id="row'.$eID.'" onMouseOver="rowHoverControls('.$eID.',\'on\');" onMouseOut="rowHoverControls('.$eID.',\'off\',\''.$class.'\')">';						$eventString .= '<td style="width: 5%;">';						if ($eReg == 1) {							if ( !empty($eRegURL) && ($eRegURL != 'http://') ) {								$regURL = $eRegURL;							} else {								$regURL = 'register.php?eID='.$eID;							}							$eventString .= '<a href="'.$regURL.'" title="Register for this event"><img src="images/buttonRegister.gif" style="border: none;" alt="Register for this event" /></a>';						}						$eventString .= '</td>';						$eventString .= '<td style="width: 30%;"><b><a href="'.$_SERVER[PHP_SELF].'?eID='.$eID.'">'.$eTitle.'</a></b></td>';						$eventString .= '<td style="width: 10%;">'.$dateStart.'</td>';						$eventString .= '<td style="width: 10%;">'.$dateEnd.'</td>';					$eventString .= '</tr>';									$i++;				}				$eventString .= '</table>';			} else {				$eventString .= 'There are currently no items under <b>'.$catName.'</b>.';							}		}		echo $eventString;	}	?>	</div>
<? include("includes/footer.php"); ?>		